package ckw.gui;

import org.eclipse.jface.wizard.Wizard;

import core.database.model.Member;

public class WzdAddEditMember extends Wizard {
	
	private boolean addMember;
	private Member member;
	
	private WzdPgAddEditMember wzdPgAddEditMember;

	public WzdAddEditMember(boolean addMember, Member member) {
		if (addMember) {
			setWindowTitle("Add Member");
		} else {
			setWindowTitle("Edit Member");
		}
		
		this.addMember = addMember;
		this.member = member;
	}

	@Override
	public void addPages() {
		wzdPgAddEditMember = new WzdPgAddEditMember(addMember, member);
		addPage(wzdPgAddEditMember);
	}

	@Override
	public boolean performFinish() {
		wzdPgAddEditMember.update();
		
		return true;
	}
}
